home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-04-20 | 549 b | 25 lines |
- import java.awt.*;
-
- /**
- * The top-level frame for the user interface.
- * This class gives the ui a home and knows how to exit gracefully.
- */
- public class TopFrame extends Frame {
-
- /** Construct a frame with a title. */
- public TopFrame(String s) {
- super(s);
- }
-
- /** Handles the user clicking the close icon. */
- public boolean handleEvent(Event e) {
- if (e.id == Event.WINDOW_DESTROY) {
- hide();
- dispose();
- System.exit(0);
- }
- return super.handleEvent(e);
- }
-
- }
-